package com.cdqidi.core.weixinmanager.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 解绑日志
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UnbindLogDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "解绑日志";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "日志ID"})
    @NotBlank(message = "日志ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "日志ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String logId;
    /**
     * 用户ID
     */
    @ExcelProperty(value = {EXCEL_TITLE, "用户ID"})
    @NotBlank(message = "用户ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 用户姓名
     */
    @ExcelProperty(value = {EXCEL_TITLE, "用户姓名"})
    @Size(max = 200, message = "用户姓名长度不能超过{max}位", groups = DefaultGroup.class)
    private String userName;
    /**
     * 用户标识
     */
    @ExcelProperty(value = {EXCEL_TITLE, "用户标识"})
    @NotBlank(message = "用户标识不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "用户标识长度不能超过{max}位", groups = DefaultGroup.class)
    private String openId;
    /**
     * 手机号码
     */
    @ExcelProperty(value = {EXCEL_TITLE, "手机号码"})
    @Size(max = 20, message = "手机号码长度不能超过{max}位", groups = DefaultGroup.class)
    private String mobile;
    /**
     * 解绑时间
     */
    @ExcelProperty(value = {EXCEL_TITLE, "解绑时间"})
    private LocalDateTime unBindTime;
    /**
     * 公众号
     */
    @ExcelIgnore
    @NotBlank(message = "公众号不能为空", groups = DefaultGroup.class)
    @Size(max = 200, message = "公众号长度不能超过{max}位", groups = DefaultGroup.class)
    private String appId;
    /**
     * 公众号显示
     */
    @ExcelProperty(value = {EXCEL_TITLE, "公众号"})
    private String appIdDisplay;

    @Override
    public void freeData() {
        this.logId = null;
        this.userId = null;
        this.userName = null;
        this.openId = null;
        this.mobile = null;
        this.unBindTime = null;
        this.appId = null;
        this.appIdDisplay = null;
        super.freeData();
    }
}
